layui.use('form', function () {
    var form = layui.form;
    //登陆表单显示密码
    form.on('switch(loginShow)', function(data){
        if(data.elem.checked == true){
            $("#loginPassword").attr("type","text");
        }
        else{
            $("#loginPassword").attr("type","password");
        }
    });  

    //注册表单显示密码
    form.on('switch(registerShow)', function(data){
        if(data.elem.checked == true){
            $("#registerPassword1").attr("type","text");
            $("#registerPassword2").attr("type","text");
        }
        else{
            $("#registerPassword1").attr("type","password");
            $("#registerPassword2").attr("type","password");
        }
    }); 
});